crypto/secp256k1: update function receiver variable name to lower-case style#29889
Merged
Merged
Conversation
fjl
approved these changes
May 30, 2024
jorgemmsilva
pushed a commit
to iotaledger/go-ethereum
that referenced
this pull request
Jun 17, 2024
19 tasks
19 tasks
gzliudan
pushed a commit
to gzliudan/XDPoSChain
that referenced
this pull request
Jan 4, 2025
eomti-wm
pushed a commit
to wemixarchive/go-wemix
that referenced
this pull request
Mar 13, 2026
hominlee-wemade
pushed a commit
to wemixarchive/go-wemix
that referenced
this pull request
May 19, 2026
* fix: use aes blocksize Co-Authored-By: Gary Rong <garyrong0905@gmail.com> * fix: ECIES invalid-curve handling (ethereum#33669) Fix ECIES invalid-curve handling in RLPx handshake (reject invalid ephemeral pubkeys early) - Add curve validation in crypto/ecies.GenerateShared to reject invalid public keys before ECDH. - Update RLPx PoC test to assert invalid curve points fail with ErrInvalidPublicKey. Motivation / Context RLPx handshake uses ECIES decryption on unauthenticated network input. Prior to this change, an invalid-curve ephemeral public key would proceed into ECDH and only fail at MAC verification, returning ErrInvalidMessage. This allows an oracle on decrypt success/failure and leaves the code path vulnerable to invalid-curve/small-subgroup attacks. The fix enforces IsOnCurve validation up front. * fix: define NDEBUG only if not defined (ethereum#27550) * fix: harden secp256k1 validation and introduce EllipticCurve interface * refactor: change receiver variable name to lowercase (ethereum#29889) * refactor: remove hardcoded value for secp256k1.N (ethereum#30126) * fix: add IsOnCurve check (ethereum#31100) * feat: update libsecp256k1 (ethereum#31242) Updates the libsecp256k1 dependency to commit: c0d9480fbbf8eccbd4be23ed27f6f2af6f3b211e PR: ``` BenchmarkSign-24 57756 21214 ns/op 164 B/op 3 allocs/op BenchmarkRecover-24 37156 33044 ns/op 80 B/op 1 allocs/op BenchmarkEcrecoverSignature-24 36889 32935 ns/op 80 B/op 1 allocs/op BenchmarkVerifySignature-24 41163 29207 ns/op 0 B/op 0 allocs/op BenchmarkDecompressPubkey-24 318624 4062 ns/op 304 B/op 6 allocs/op ``` Master: ``` BenchmarkSign-24 34509 35330 ns/op 164 B/op 3 allocs/op BenchmarkRecover-24 25418 47725 ns/op 80 B/op 1 allocs/op BenchmarkEcrecoverSignature-24 25735 47591 ns/op 80 B/op 1 allocs/op BenchmarkVerifySignature-24 29108 41097 ns/op 0 B/op 0 allocs/op BenchmarkDecompressPubkey-24 294747 4143 ns/op 304 B/op 6 allocs/op ``` Performance seems to be improved significantly: ``` Sign-24 34.86µ ± 3% 21.66µ ± 2% -37.86% (p=0.000 n=10) Recover-24 46.14µ ± 3% 33.24µ ± 2% -27.95% (p=0.000 n=10) ``` * fix: coordinate check --------- Co-authored-by: lightclient <lightclient@protonmail.com> Co-authored-by: Gary Rong <garyrong0905@gmail.com> Co-authored-by: fengjian <445077+fengjian@users.noreply.github.com> Co-authored-by: Francisco de Borja Aranda Castillejo <me@fbac.dev> Co-authored-by: SuiYuan <165623542+suiyuan1314@users.noreply.github.com> Co-authored-by: zhiqiangxu <652732310@qq.com> Co-authored-by: Felix Lange <fjl@twurst.com> Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.